Skip to content

ai: bound prompt IO for Codex and Copilot CLI providers - #750

Draft
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/cli-prompt-io-deadlock-review
Draft

OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/cli-prompt-io-deadlock-review

Conversation

@OllieinCanada

Copy link
Copy Markdown
Contributor

Codex and Copilot wrote stdin before draining output and starting their timeout. Transfer input and collect output concurrently under the existing deadline, preserving diagnostics and Claude behavior.

Offline regressions fail before the repair and pass afterward. Rust 1.90.0: make check-pr passed; 1,156 tests passed, two ignored; formatting and three Clippy profiles passed. The inherited RUST_LOG override was unset. No schema changes or historical data rewrites.

DRAFT: required local Sashiko model self-review is incomplete because provider authentication failed. No clean local review is claimed. Keep as draft until the required review completes and findings are addressed.

Base: d7c69ae
Head: 4d72afb

Writing the whole prompt before draining output can deadlock when a CLI
fills an output pipe first. A child that does not read stdin also keeps
prompt transfer outside the existing call timeout.

Share Claude's collector to transfer input and drain output
concurrently, with the existing deadline around the whole operation.
Preserve nonzero exit diagnostics when stdin closes early, and reject
successful exits whose prompt transfer failed. Keep Claude's typed error
classification.

Add offline process fixtures for both providers covering stalled stdin,
startup stderr, early failure diagnostics and incomplete prompt
delivery.

Fixes: 6fb16bc ("feat: add codex-cli provider for OpenAI Codex subscription auth")
Fixes: 10a28b5 ("ai/copilot-cli: pipe prompt via stdin to avoid E2BIG on large reviews")
Signed-off-by: Ollie Slapinski <oliverslapinski@hotmail.com>
@OllieinCanada
OllieinCanada marked this pull request as draft October 26, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant